package com.sise.cn.task.annotation;

import org.quartz.CronExpression;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * @author 龚秀峰
 * @version 1.0
 * @date 2020/6/7 12:59
 * corn表达式校验逻辑
 */
public class CornValidator implements ConstraintValidator<CornCheck, String> {

    @Override
    public boolean isValid(String cron, ConstraintValidatorContext constraintValidatorContext) {
        return CronExpression.isValidExpression(cron);
    }
}
